<?php /*a:2:{s:59:"D:\phpStudy\WWW\blog\application\admin\view\blog\index.html";i:1544252340;s:48:"D:\phpStudy\WWW\blog\application\view\admin.html";i:1544171026;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>I Can Flay</title>
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/bootstrap/css/bootstrap.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/font-awesome/css/font-awesome.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/vendors/nprogress/nprogress.css'); ?>">
    <link rel="stylesheet" href="<?php echo asset('admin/css/admin.css'); ?>">
    <script src="<?php echo asset('admin/vendors/nprogress/nprogress.js'); ?>"></script>
    <!--css内容-->
    
<link rel="stylesheet" type="text/css" href="<?php echo asset('bootstrap-3.3.7/css/bootstrap.css'); ?>"/>

</head>
<body>
<script>NProgress.start()</script>
<div class="main">
    <nav class="navbar">
        <button class="btn btn-default navbar-btn fa fa-bars"></button>
        <ul class="nav navbar-nav navbar-right">
            <li><a href="<?php echo url('admin/index/personal'); ?>"><i class="fa fa-user"></i>个人中心</a></li>
            <li><a href="<?php echo url('admin/index/tuichu'); ?>"><i class="fa fa-sign-out"></i>退出</a></li>
        </ul>
    </nav>
    <!--内容-->

    <ul class="nav nav-tabs">
        <li role="presentation" ><a href="<?php echo url('admin/index/index'); ?>">首页</a></li>
        <li role="presentation" class="active"><a href="#">博文管理</a></li>
    </ul>
    <div class="search-wrap">
        <div class="search-content">
            <form action="<?php echo url('admin/blog/blogsearch'); ?>" method="post">
            <table class="search-tab">
                <tr>
                    <th width="120">选择分类:</th>
                    <td>
                        <select name="id">
                            <option value="">全部</option>
                            <?php foreach($date as $item): ?>
                            <option name="<?php echo htmlentities($item['id']); ?>" value="<?php echo htmlentities($item['id']); ?>"><?php echo htmlentities($item['title']); ?></option>
                            <?php endforeach; ?>
                        </select>
                    </td>
                    <th width="70">关键字:</th>
                    <td><input class="common-text" placeholder="关键字" name="name" type="text"></td>
                    <td><input class="btn btn-primary btn2" id="search" value="查询" type="submit"></td>
                </tr>
            </table>
        </form>
        </div>
    </div>
    <div class="result-wrap">
        <form name="myform" id="myform" method="post">
            <ul class="nav nav-pills">
                <li role="presentation" class="active"><a id="add" href="<?php echo url('admin/blog/blogadd'); ?>">添加文章</a></li>
            </ul>
            <div class="result-content">
                <table class="table table-hover">
                    <tr>
                        <th>标题</th>
                        <th>图片</th>
                        <th>所属分类</th>
                        <th>作者</th>
                        <th>最近更新时间</th>
                        <th>点击数</th>
                        <th>操作</th>
                    </tr>
                    <?php foreach($dete as $item): ?>
                    <tr>
                        <td ><?php echo htmlentities($item['name']); ?></td>
                        <td>
                            <img src="http://www.blog.com/<?php echo htmlentities($item['image']); ?>" width="80px" alt="">
                        </td>
                        <td><?php echo htmlentities($item['title']); ?></td>
                        <td><?php echo htmlentities($item['author']); ?></td>
                        <td><?php echo htmlentities($item['update_time']); ?></td>
                        <td><?php echo htmlentities($item['click']); ?></td>
                        <td>
                            <a class="btn btn-info link-update" href="<?php echo url('admin/blog/blogupd?id='); ?><?php echo htmlentities($item['id']); ?>">修改</a>
                            <a id="<?php echo htmlentities($item['id']); ?>" class="btn btn-danger link-del" href="#">删除</a>
                        </td>
                    </tr>
                    <?php endforeach; ?>
                </table>
                <nav aria-label="Page navigation">
                    <?php echo $dete; ?>
                </nav>
            </div>
        </form>
    </div>

</div>
<div class="aside">
    <div class="profile">
        <img class="avatar" src="http://www.blog.com/<?php echo htmlentities($data['0']['mylogo']); ?>">
        <h3 class="name">admin</h3>
    </div>
    <ul class="nav">
        <li class="active">
            <a href="<?php echo url('admin/index/index'); ?>"><i class="fa fa-dashboard"></i>仪表盘</a>
        </li>
        <li>
            <a href="#menu-posts" class="collapsed" data-toggle="collapse">
                <i class="fa fa-thumb-tack"></i>文章<i class="fa fa-angle-right"></i>
            </a>
            <ul id="menu-posts" class="collapse">
                <li><a href="<?php echo url('admin/blog/index'); ?>">所有文章</a></li>
                <li><a href="<?php echo url('admin/blog/blogadd'); ?>">写文章</a></li>
                <li><a href="<?php echo url('admin/cate/index'); ?>">分类目录</a></li>
            </ul>
        </li>
        <li>
            <a href="<?php echo url('admin/discuss/index'); ?>"><i class="fa fa-comments"></i>评论</a>
        </li>
    </ul>
</div>
</body>

<!--js内容-->
<script src="<?php echo asset('admin/vendors/jquery/jquery.js'); ?>"></script>
<script src="<?php echo asset('admin/vendors/bootstrap/js/bootstrap.js'); ?>"></script>
<script src="<?php echo asset('layer/layer.js'); ?>"></script>
<script>NProgress.done()</script>

<script>
    $(function() {
        $('.link-del').click(function () {
            var id = $(this).attr('id');
            $.ajax({
                url: "<?php echo url('admin/blog/blogdel'); ?>",
                type: 'get',
                data: {id: id},
                dataType: 'json',
                success: function (msg) {
                    if (msg == 1) {
                        layer.alert('删除成功', {icon: 6}, function () {
                            parent.location.reload();
                            window.location.href = "<?php echo url('admin/blog/index'); ?>";
                        })
                    } else {
                        layer.alert('删除失败', {icon: 5})
                    }
                }
            })
        })
    })
</script>

</html>